<template>
  <div class="body1">
    <div class="no-print el-button-print">
      <el-button @click="addForm">添加页</el-button>
      <el-button @click="deleteForm">删除页</el-button>
      <el-button @click="exportPDF">导出为pdf</el-button>
    </div>
    <div class="body2" id="pdfDom" :class="{ 'pdf-export': isPdfExport }">
      <div class="title">
        <div class="biaotididian">{{ agencyName }}</div>
        <div class="biaoti">重大案件集体讨论记录</div>
      </div>
      <div class="tableStyle1">
        <!-- 主体-->
        <div class="writ-height">
          <span>讨论时间：</span>
          <editable-textarea :text="form.date1" param-type="YYYYMMDD1"
            @send-to-parent="receiveFromChild"></editable-textarea>
          <editable-textarea :text="form.time1" param-type="HH:mm1"
            @send-to-parent="receiveFromChild"></editable-textarea>
          <span>至</span>
          <editable-textarea :text="form.time2" param-type="HH:mm2"
            @send-to-parent="receiveFromChild"></editable-textarea>
        </div>
        <div class="writ-height">
          <span>讨论地点：</span>
          <input v-model="form.a1" :resize="'none'" autosize maxlength="27" class="inputStyle1"
            style="width: calc(27 * 5mm);font-family: 仿宋;font-size: 5mm;" type="textarea">
        </div>
        <div class="writ-height">
          <span>案&nbsp;&nbsp;&nbsp;&nbsp;由：</span>
          <input v-model="form.a2" :resize="'none'" autosize maxlength="27" class="inputStyle1"
            style="width: calc(27 * 5mm);font-family: 仿宋;font-size: 5mm;" type="textarea">
        </div>
        <div class="writ-height">
          <span>主&nbsp;持&nbsp;人：</span>
          <input v-model="form.a3" :resize="'none'" autosize maxlength="27" class="inputStyle1"
            style="width: calc(27 * 5mm);font-family: 仿宋;font-size: 5mm;" type="textarea">
        </div>
        <div style="height:70px; line-height: 30px;">
          <span>出席人员：</span>
          <CrossRowInput v-model:value="form.a4" :line-config="a4Config"></CrossRowInput>
        </div>
        <div style="height:70px; line-height: 30px;">
          <span>列席人员：</span>
          <CrossRowInput v-model:value="form.a5" :line-config="a5Config"></CrossRowInput>
        </div>
        <div class="writ-height">
          <span>汇报人：</span>
          <input v-model="form.a6" :resize="'none'" autosize maxlength="8" class="inputStyle1"
            style="width: calc(8 * 5mm);font-family: 仿宋;font-size: 5mm;" type="textarea">
          <span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;记录人：</span>
          <input v-model="form.a7" :resize="'none'" autosize maxlength="8" class="inputStyle1"
            style="width: calc(8 * 5mm);font-family: 仿宋;font-size: 5mm;" type="textarea">
        </div>
        <div style="height: 532px; width: 162mm">
          <el-input type="textarea" v-model="form.v1" :rows="v1Config.maxLines"
            @keydown.native="handleKeyDown('v1', $event)" @input="handleInput('v1', $event)"
            @paste.native="handlePaste('v1', $event)" class="el-textarea-hidden"
            style=" height: 100%;white-space: pre;overflow-x: auto;font-family: monospace;" wrap="soft" />
        </div>
        <div class="page-number-div">
          第1页/共{{ form.continuationSheet.length + 2 }}页
        </div>
      </div>
      <div v-for="(item, index) in form.continuationSheet" :key="index" class="page-break">
        <div class="title">
          <div class="biaotididian">重大案件集体讨论记录（续页）</div>
        </div>
        <div class="tableStyle1">
          <div style="height: 842px; width: 162mm;">
            <el-input type="textarea" v-model="item.v2" :rows="v2Config[index].maxLines"
              @keydown.native="continuationSheetHandleKeyDown('v2-' + index, $event)"
              @input="continuationSheetHandleInput('v2-' + index, $event)"
              @paste.native="continuationSheetHandlePaste('v2-' + index, $event)" class="el-textarea-hidden"
              style=" height: 100%;white-space: pre;overflow-x: auto;font-family: monospace;" wrap="soft" />
          </div>
          <div class="page-number-div" style="margin-top: 30px;">
            第{{ index + 2 }}页/共{{ form.continuationSheet.length + 2 }}页
          </div>
        </div>
      </div>
      <div class="page-break">
        <div class="title">
          <div class="biaotididian">重大案件集体讨论记录（续页）</div>
        </div>
        <div class="tableStyle1">
          <div style="height: 602px; width: 162mm;">
            <el-input type="textarea" v-model="form.v3" :rows="v3Config.maxLines"
              @keydown.native="handleKeyDown('v3', $event)" @input="handleInput('v3', $event)"
              @paste.native="handlePaste('v3', $event)" class="el-textarea-hidden"
              style=" height: 100%;white-space: pre;overflow-x: auto;font-family: monospace;" wrap="soft" />
          </div>
          <div class="el-button-Sign" :style="{ top: signButtomRow }">
            <el-button @click="addBrainstormNumber">增加讨论人员签名</el-button>
            <el-button @click="reduceBrainstormNumber">减少讨论人员签名</el-button>
          </div>
          <div style="height: 230px; position: relative;">
            <div :style="{
              position: 'absolute',
              bottom: signRow,
              left: '0px',
              right: '20px',
              display: 'flex',
              justifyContent: 'space-between',
              alignItems: 'flex-end'
            }">
              <div style="display: flex; align-items: flex-end;">
                主持人签名：
                <span style="border-bottom: 1px solid black; padding-bottom: 6px;">
                  <SignatureField label="签名1" sign-type="sign1" :img-url="form.img1"
                    @update:imgUrl="form.img1 = $event" />
                </span>

              </div>
              <div>
                <editable-textarea :text="form.date2" param-type="YYYYMMDD2"
                  @send-to-parent="receiveFromChild"></editable-textarea>
              </div>
            </div>
            <div :style="{
              position: 'absolute',
              bottom: signRow1,
              left: '0px',
              right: '20px',
              display: 'flex',
              justifyContent: 'space-between',
              alignItems: 'flex-end'
            }">
              <div style="display: flex; align-items: flex-end; max-width: 4;">
                集体讨论人员签名：
                <div v-for="index in minNumber(6, form.brainstormNumber)" style="display: flex; align-items: flex-end;">
                  <span v-if="index != 1">，</span>
                  <span style="border-bottom: 1px solid black; padding-bottom: 6px;">
                    <SignatureField :label="'签名' + (2 + index)" :sign-type="'sign' + (2 + index)"
                      :img-url="form['img' + (2 + index)]" @update:imgUrl="val => form['img' + (2 + index)] = val" />
                  </span>
                </div>
              </div>
              <div v-if="form.brainstormNumber <= 4">
                <editable-textarea :text="form.date3" param-type="YYYYMMDD3"
                  @send-to-parent="receiveFromChild"></editable-textarea>
              </div>
            </div>
            <div v-if="form.brainstormNumber > 4" :style="{
              position: 'absolute',
              bottom: signRow2,
              left: '0px',
              right: '20px',
              display: 'flex',
              justifyContent: 'space-between',
              alignItems: 'flex-end'
            }">
              <div style="display: flex; align-items: flex-end; max-width: 4;">
                <div v-for="index in minNumber(9, form.brainstormNumber - 6 > 0 ? form.brainstormNumber - 6 : 0)"
                  style="display: flex; align-items: flex-end;">
                  <span v-if="index != 1">，</span>
                  <span style="border-bottom: 1px solid black; padding-bottom: 6px;">
                    <SignatureField :label="'签名' + (8 + index)" :sign-type="'sign' + (8 + index)"
                      :img-url="form['img' + (8 + index)]" @update:imgUrl="val => form['img' + (8 + index)] = val" />
                  </span>
                </div>
              </div>
              <div v-if="form.brainstormNumber <= 13">
                <editable-textarea :text="form.date3" param-type="YYYYMMDD3"
                  @send-to-parent="receiveFromChild"></editable-textarea>
              </div>
            </div>
            <div v-if="form.brainstormNumber > 13" :style="{
              position: 'absolute',
              bottom: '50px',
              left: '0px',
              right: '20px',
              display: 'flex',
              justifyContent: 'space-between',
              alignItems: 'flex-end'
            }">
              <div style="display: flex; align-items: flex-end; max-width: 4;">
                <div v-for="index in minNumber(7, form.brainstormNumber - 15 > 0 ? form.brainstormNumber - 15 : 0)"
                  style="display: flex; align-items: flex-end;">
                  <span v-if="index != 1">，</span>
                  <span style="border-bottom: 1px solid black; padding-bottom: 6px;">
                    <SignatureField :label="'签名' + (17 + index)" :sign-type="'sign' + (17 + index)"
                      :img-url="form['img' + (17 + index)]" @update:imgUrl="val => form['img' + (17 + index)] = val" />
                  </span>
                </div>
              </div>
              <div>
                <editable-textarea :text="form.date3" param-type="YYYYMMDD3"
                  @send-to-parent="receiveFromChild"></editable-textarea>
              </div>
            </div>
            <div
              style="position: absolute; bottom: 10px; left: 0px; right: 20px; display: flex; justify-content: space-between; align-items: flex-end; ">
              <div style="display: flex; align-items: flex-end;">
                记录人签名：
                <span style="border-bottom: 1px solid black; padding-bottom: 6px;">
                  <SignatureField label="签名2" sign-type="sign2" :img-url="form.img2"
                    @update:imgUrl="form.img2 = $event" />
                </span>
              </div>
              <div>
                <editable-textarea :text="form.date4" param-type="YYYYMMDD4"
                  @send-to-parent="receiveFromChild"></editable-textarea>
              </div>
            </div>
          </div>
          <div class="writ-height">
            <span>备注：</span>
            <input v-model="form.a8" :resize="'none'" autosize maxlength="29" class="inputStyle2"
              style="width: calc(29 * 5mm);font-family: 仿宋;font-size: 5mm;" type="textarea">
          </div>
          <div class="page-number-div" style="margin-top: 10px;">
            第{{ form.continuationSheet.length + 2 }}页/共{{ form.continuationSheet.length + 2 }}页
          </div>
        </div>
      </div>
    </div>
  </div>

</template>

<script>
import EditableTextarea from "@/views/template/EditableTextarea";
import { agencyName, sealName } from "../../utils/publicName.js"

import InvestigatorSelect from "@/views/template/InvestigatorSelect";
import CrossRowInput from "@/views/template/CrossRowInput";
import SignatureField from "@/views/template/SignatureField";
import { createInputLimiter } from '@/utils/limitInput';


export default {
  components: {
    EditableTextarea,
    InvestigatorSelect,
    CrossRowInput,
    SignatureField,
  },

  data() {
    return {
      agencyName: agencyName,
      sealName: sealName,
      form: {
        continuationSheet: [],
        v1: '',
        v3: '',
        // 集体讨论人员人数
        brainstormNumber: 1,
      },

      // 集体讨论签名css定位数据
      signRow: '90px',  //这个控制主持人签名的定位
      signRow1: '50px',
      signRow2: '50px',
      signButtomRow: '100px',


      status: '', //当前文书的状态
      isPdfExport: false, //控制打印样式
      v1Config: {
        maxLines: 17,
        charsPerLine: 32 * 2,
        maxLength: 17 * 32 * 2,
        inputLimiter: null,
        displayText: ''
      },
      v2Config: [],
      v3Config: {
        maxLines: 20,
        charsPerLine: 32 * 2,
        maxLength: 20 * 32 * 2,
        inputLimiter: null,
        displayText: ''
      },

      a4Config: {
        firstLine: { chars: 27 * 2 },
        middleLines: { count: 0, chars: 32 * 2 },
        lastLine: { chars: 32 * 2 }
      },
      a5Config: {
        firstLine: { chars: 27 * 2 },
        middleLines: { count: 0, chars: 32 * 2 },
        lastLine: { chars: 32 * 2 }
      },

    }
  },

  created() {
    window.parent.getTemplateData((data, status) => {
      this.form = data;
      this.status = status;
      for (let i = 0; i < this.form.continuationSheet.length; i++) {
        this.v2Config.push({
          maxLines: 28,
          charsPerLine: 32 * 2,
          maxLength: 28 * 32 * 2,
          inputLimiter: null,
          displayText: ''
        })
        this.v2Config[i].inputLimiter = createInputLimiter(this, {
          maxLines: this.v2Config[i].maxLines,
          charsPerLine: this.v2Config[i].charsPerLine,
          maxLength: this.v2Config[i].maxLength,
          propName: `form.continuationSheet[${i}].v2`
        });
      }
      this.initSignPosition();
    })
    window.postForm = () => {
      this.postForm();
    }
    this.v1Config.inputLimiter = createInputLimiter(this, {
      maxLines: this.v1Config.maxLines,
      charsPerLine: this.v1Config.charsPerLine,
      maxLength: this.v1Config.maxLength,
      propName: `form.v1`
    });
    this.v3Config.inputLimiter = createInputLimiter(this, {
      maxLines: this.v3Config.maxLines,
      charsPerLine: this.v3Config.charsPerLine,
      maxLength: this.v3Config.maxLength,
      propName: `form.v3`
    });
  },

  mounted() {
    window.parent.changeTemplateDow();
  },

  methods: {
    // 按字节长度截取字符串（中英文混合）
    subStringByMaxBytes(str, maxBytes, maxRow) {
      if (!str || maxBytes <= 0) return '';

      let bytesCount = 0;
      let result = '';
      let rowCount = 0;

      for (let i = 0; i < str.length; i++) {
        const char = str.charAt(i);
        const charCode = str.charCodeAt(i);

        // 计算当前字符的字节数（中文2字节，其他1字节）
        const charBytes = charCode > 127 ? 2 : 1;

        // 检查是否超过最大字节限制
        if (bytesCount + charBytes > maxBytes) {
          break;
        }

        // 忽略换行符，直接跳过不计算
        if (char === '\n') {
          rowCount++;
          if (rowCount >= maxRow) {
            break;
          }
          result += char;
          continue;
        }

        bytesCount += charBytes;
        result += char;
      }

      return result;
    },

    // 添加页
    addForm() {
      this.form.continuationSheet.push({
        v2: '',
      });
      this.v2Config.push({
        maxLines: 28,
        charsPerLine: 32 * 2,
        maxLength: 28 * 32 * 2,
        inputLimiter: null,
        displayText: ''
      })
      this.v2Config[this.v2Config.length - 1].inputLimiter = createInputLimiter(this, {
        maxLines: this.v2Config[this.v2Config.length - 1].maxLines,
        charsPerLine: this.v2Config[this.v2Config.length - 1].charsPerLine,
        maxLength: this.v2Config[this.v2Config.length - 1].maxLength,
        propName: `form.continuationSheet[${this.v2Config.length - 1}].v2`
      });
      this.form.continuationSheet[this.form.continuationSheet.length - 1].v2 = this.form.v3;
      this.form.v3 = '';
    },
    // 删除页
    deleteForm() {
      if (this.form.continuationSheet.length > 0) {
        let maxLength = this.v3Config.maxLength;
        let maxRow = this.v3Config.maxLines;
        let subString = this.form.continuationSheet[this.form.continuationSheet.length - 1].v2
        this.form.v3 = this.subStringByMaxBytes(subString, maxLength, maxRow);
        this.form.continuationSheet.pop();
        this.v2Config.pop();
      } else {
        // 使用Element UI的提示（确保已引入ElMessage）
        this.$message.warning('无法删除这一页');
      }
    },
    // 固定页处理输入
    getConfigName(field) {
      switch (field) {
        case 'v1':
          return this.v1Config;
        case 'v3':
          return this.v3Config;
      }
    },
    handleKeyDown(field, e) {
      const config = this.getConfigName(field);
      config.inputLimiter.handleKeyDown(e);
    },
    handleInput(field, value) {
      const config = this.getConfigName(field);
      this.form[field] = config.inputLimiter.handleInput(value);
    },
    handlePaste(field, e) {
      const config = this.getConfigName(field);
      config.inputLimiter.handlePaste(e);
    },
    // 续表处理输入
    continuationSheetGetConfigName(field) {
      // 将field按-拆分
      const parts = field.split('-');
      const index = parts[1];
      switch (field) {
        case 'v2-' + index:
          return this.v2Config[index];
      }
    },
    continuationSheetHandleKeyDown(field, e) {
      const config = this.continuationSheetGetConfigName(field);
      config.inputLimiter.handleKeyDown(e);
    },
    continuationSheetHandleInput(field, value) {
      const config = this.continuationSheetGetConfigName(field);
      const parts = field.split('-');
      const field1 = parts[0]
      const index = parts[1];

      // form.continuationSheet数组的第index个中的filed1属性
      this.form.continuationSheet[index][field1] = config.inputLimiter.handleInput(value);
    },
    continuationSheetHandlePaste(field, e) {
      const config = this.continuationSheetGetConfigName(field);
      config.inputLimiter.handlePaste(e);
    },

    // 导出为pdf
    exportPDF() {
      this.savePDF()
        .then((blob) => {

          const blobUrl = URL.createObjectURL(blob);

          // 先预览
          const previewWindow = window.open(blobUrl, '_blank');

          // 自动下载
          const fileName = `重大案件集体讨论记录.pdf`;
          const downloadLink = document.createElement('a');
          downloadLink.href = blobUrl;
          downloadLink.download = fileName;
          document.body.appendChild(downloadLink);
          downloadLink.click();
          document.body.removeChild(downloadLink);

          // 监听预览窗口关闭后释放内存
          if (previewWindow) {
            const timer = setInterval(() => {
              if (previewWindow.closed) {
                clearInterval(timer);
                URL.revokeObjectURL(blobUrl);
              }
            }, 1000);
          } else {
            setTimeout(() => URL.revokeObjectURL(blobUrl), 10000); // 兜底释放
          }
        })
        .catch(error => {
          console.error('导出PDF出错:', error);
          alert('导出失败，请重试或联系管理员');
        });
    },
    savePDF() {
      this.isPdfExport = true; // 激活PDF样式
      return new Promise((resolve, reject) => {
        this.$nextTick(() => {
          import('html2pdf.js').then((module) => {
            const html2pdf = module.default;

            //获取所有需要替换的 el-input
            const elInputs = document.querySelectorAll('.el-textarea-hidden .el-input__inner, .el-textarea-hidden .el-textarea__inner');

            //存储原始元素和它们的父节点，方便后续恢复
            const originalElements = [];

            elInputs.forEach((input) => {
              const div = document.createElement('div');
              div.style.whiteSpace = 'pre-wrap'; // 保留换行
              div.style.fontFamily = '仿宋';
              div.style.fontSize = '19px';
              div.style.height = '100%';
              div.style.width = '100%';

              div.textContent = input.value; // 保留原内容（自动处理 \n 换行）
              div.style.lineHeight = '30px';
              div.style.backgroundImage = 'linear-gradient(to top, #000 1px, transparent 1px)';
              div.style.backgroundSize = '100% 30px';
              div.style.backgroundRepeat = 'repeat-y';
              div.style.backgroundPosition = '0 -3px';
              div.style.padding = '0';
              div.style.boxSizing = 'border-box';


              // 替换 el-input，并存储原始元素
              originalElements.push({
                parent: input.parentNode,
                original: input,
                replacement: div,
              });
              input.parentNode.replaceChild(div, input);
            });

            // 处理选择执法人的替换
            const InvestigatorSelectSelects = document.querySelectorAll('.InvestigatorSelectReplace .el-input__inner, .InvestigatorSelectReplace .el-textarea__inner');
            InvestigatorSelectSelects.forEach((input) => {
              const div = document.createElement('div');
              div.style.whiteSpace = 'pre-wrap'; // 保留换行
              div.style.fontFamily = '仿宋';
              div.style.fontSize = '5mm';
              div.textContent = input.value; // 保留原内容（自动处理 \n 换行）
              div.style.lineHeight = '1.3';

              // 替换 el-input，并存储原始元素
              originalElements.push({
                parent: input.parentNode,
                original: input,
                replacement: div,
              });
              input.parentNode.replaceChild(div, input);
            });

            // 配置选项
            const opt = {
              margin: 0,
              image: {
                type: 'jpeg',
                quality: 0.98
              },
              html2canvas: {
                scale: 2,
                logging: false,
                useCORS: true
              },
              jsPDF: {
                unit: 'mm',
                format: 'a4',
                orientation: 'portrait'
              }
            };

            const element = document.getElementById('pdfDom');

            // 生成PDF Blob对象
            html2pdf()
              .set(opt)
              .from(element)
              .toPdf()
              .get('pdf')
              .then((pdf) => {
                const blob = pdf.output('blob');

                resolve(blob); // 返回Blob对象
              })
              .catch((error) => {
                reject(error);
              })
              .finally(() => {
                this.isPdfExport = false; // 恢复原始样式
                // 恢复原始input
                originalElements.forEach(({ parent, original, replacement }) => {
                  parent.replaceChild(original, replacement);
                });
              });
          }).catch((error) => {
            reject(error);
            this.isPdfExport = false;
            originalElements.forEach(({ parent, original, replacement }) => {
              parent.replaceChild(original, replacement);
            });
          });
        });
      });
    },
    //父页面提交按钮将调用此方法，此方法将文书数据回传到父页面的请求方法中
    postForm() {
      this.savePDF()
        .then((blob) => {


          // 创建FormData并添加文件
          const formData = new FormData();
          formData.append('file', blob, '重大案件集体讨论记录.pdf');

          window.parent.postTemplateDate(this.form, formData);
        })
        .catch(error => {
          console.error('整个保存PDF出错:', error);
        });
    },
    //选择日期时间
    receiveFromChild(data, type) {
      const TypeMap = {
        'HH:mm1': 'time1',
        'HH:mm2': 'time2',
        'YYYYMMDD1': 'date1',
        'YYYYMMDD2': 'date2',
        'YYYYMMDD3': 'date3',
        'YYYYMMDD4': 'date4',
        'YYYYMMDD5': 'date5',
      };
      if (TypeMap[type]) {
        this.form[TypeMap[type]] = data;
      }
    },
    //选择执法人员
    handleInvestigatorChange({ identificationNumber, idField }) {
      if (idField && identificationNumber) {
        this.form[idField] = identificationNumber;
      }
    },
    minNumber(a, b) {
      return Math.min(a, b);
    },
    // 增加讨论人员签名
    addBrainstormNumber() {
      console.log(this.form.brainstormNumber)

      if (this.form.brainstormNumber < 22) {
        this.form.brainstormNumber++;
      } else {
        this.$message({
          message: '最多添加到二十二个',
          type: 'warning',
        })
      }
      if (this.form.brainstormNumber > 13) {
        this.signRow = '170px';
        this.signRow1 = '130px';
        this.signRow2 = '90px';
        this.signButtomRow = '20px';
      } else if (this.form.brainstormNumber > 4) {
        this.signRow = '130px';
        this.signRow1 = '90px';
        this.signButtomRow = '60px';
      }
    },
    // 减少讨论人员签名
    reduceBrainstormNumber() {
      if (this.form.brainstormNumber > 1) {
        this.form['img' + (this.form.brainstormNumber + 2)] = '';
        this.form.brainstormNumber--;
      } else {
        this.$message({
          message: '至少保留一个',
          type: 'warning',
        })
      }
      if (this.form.brainstormNumber < 5) {
        this.signRow = '90px';
        this.signRow1 = '50px';
        this.signButtomRow = '100px';
      } else if (this.form.brainstormNumber < 14) {
        this.signRow = '130px';
        this.signRow1 = '90px';
        this.signRow2 = '50px';
        this.signButtomRow = '60px';
      }
    },
    // 初始化定位
    initSignPosition() {
      if (this.form.brainstormNumber > 13) {
        this.signRow = '170px';
        this.signRow1 = '130px';
        this.signRow2 = '90px';
        this.signButtomRow = '20px';
      } else if (this.form.brainstormNumber > 4) {
        this.signRow = '130px';
        this.signRow1 = '90px';
        this.signRow2 = '50px';
        this.signButtomRow = '60px';
      } else {
        this.signRow = '90px';
        this.signRow1 = '50px';
        this.signRow2 = '50px';
        this.signButtomRow = '100px';
      }

    }

  }
}
</script>

<style scoped>
.el-button-Sign {
  position: relative;
}

.pdf-export .el-button-Sign {
  display: none;
}

:deep(.el-button-Sign .el-button) {
  display: inline-flex !important;
  z-index: 1 !important;
  width: auto;
  min-width: 100px;
  height: auto;
  padding: 8px 15px;
  color: #000 !important;
}

:deep(.el-button-print .el-button) {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  width: auto;
  min-width: 100px;
  height: auto;
  padding: 8px 15px;
  background: #fff !important;
  color: #000 !important;
  border: none;
}

:deep(.el-textarea__inner) {
  box-shadow: 0 0 0 0;
  color: black;
  padding: 0;
  font-family: "仿宋", serif;
  font-size: 19px;
  overflow-y: hidden;
  line-height: 30px;

  /* 下划线 */
  border-radius: 0px;
  background-image: linear-gradient(to top, #000000 0.5px, transparent 1px);
  background-size: 100% 30px;
  background-position: 0 -3px;
}

:deep(.el-textarea-hidden .el-textarea__inner) {
  box-shadow: 0 0 0 0;
  color: black;
  padding: 0;
  font-family: "仿宋", serif;
  font-size: 19px;
  overflow-y: hidden !important;
  resize: none !important;
  height: auto !important;
}

:deep(.el-select .el-input__inner) {
  text-align: center;
  height: 5mm;
}

.input-container {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
}

.inputStyleNoLine {
  border: none;
  outline: none;
  padding: 0px;
}

.typeSpan {
  cursor: pointer;
  font-size: 5mm;
}
</style>
